package com.apes.fn.crm.customer;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;


/***
 * 用于组合会员和车辆使之一一对应
 */
public class FnVendorUserCar {

    private Long id;

    private String vendorCode; // 接入商编码
    private String vendorName; // 接入商名称

    /***
     * 车辆信息
     */
    private String carLicense;//车牌 一定会有
    private Long carArchive$id; //车辆编码
    private String carArchive$carLicense; //车牌 不一定有
    private String carArchive$vin; //车架号
    private String carArchive$jekunModelCode; //配置车型编码
    private String carArchive$carModelLabel; //配置车型名称
    private String carArchive$unitClient$clientCode; //单位客户编码
    private String carArchive$unitClient$clientName; //单位客户名称

    private String carArchive$insuranceTrack$lastForceEndDate; //交强险到期日期
    private String carArchive$insuranceTrack$lastCommerceEndDate; //商业险到期日期


    private String carArchive$pic1$path; //建档车头照片
    private String carArchive$pic2$path; //建档铭牌照片

    private String carArchive$pic36$path; //车档行驶证正面
    private String carArchive$pic37$path; //车档行驶证反面

    private String carArchive$pic38$path; //车档车尾照片

    private String carArchive$mileage; //行驶里程

    private String carArchive$vendorCode; //接入商名称
    private String carArchive$vendorName; //接入商名称

    /***
     * 会员信息
     */

    private Long vendorUser$id; //会员编码
    private String vendorUser$mobile; //手机号
    private String vendorUser$realname; //真实姓名
    private String vendorUser$createdAt; //创建时间
    private String vendorUser$redPacketAmount; //红包可用金额
    private String vendorUser$rechargeAmount; //储值余额
    private Long userId; // App对应的实际用户

    private String vendorUser$sex; //性别
    private String vendorUser$sexLabel; //性别名称
    private String vendorUser$activit; //会员活跃度编码
    private String vendorUser$activityLabel; //会员活跃度名称

    private String vendorUser$level; //会员等级
    private String vendorUser$levelLabel; //会员等级名称

    private String vendorUser$userRole$id; //会员身份
    private String vendorUser$userRole$name; //会员身份名称

    private String vendorUser$vendorName; //接入商名称



    static public String[] getDeclaredFields() {
        Field[] fields = FnVendorUserCar.class.getDeclaredFields();
        return Arrays.stream(fields).map(field -> field.getName().replaceAll("\\$\\$",".*").replaceAll("\\$", ".")).toArray(String[]::new);
    }

    static public Map<String, String> getDeclaredFieldType() {
        Map m = new HashMap();
        Field[] fields = FnVendorUserCar.class.getDeclaredFields();
        Arrays.stream(fields).forEach(field -> {
            m.put(field.getName(), field.getGenericType().getTypeName());
        });
        return m;
    }
}
